<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="styles.css" rel="stylesheet" type="text/css">
	<script type="text/javascript">
    function validateForm() {
       
        var dienthoai = document.forms["myForm"]["sodt"].value;
        var kiemTraDT = isNaN(dienthoai);
        if (kiemTraDT == true) {
            alert("Điện thoại phải để ở định dạng số");
            return false;
        }
        var email=document.forms["myForm"]["email"].value;
        var aCong=email.indexOf("@");
        var dauCham = email.lastIndexOf(".");
        if ((aCong<1) || (dauCham<aCong+2) || (dauCham+2>email.length)) {
            alert("Email bạn điền không chính xác");
            return false;
        }
    }
</script>
</head>
<body>
	<form class="tknc" id="dm" accept-charset="UTF-8" action="lienhe" method="post" name="myForm" onsubmit="return validateForm()">
	<div class="login-header">
			<span>Liên Hệ</span>
			<a href="trangchu" class="close">x</a>
		</div>
		<div class="login-content">
		Họ tên : <input type="text" name="hoten" required > <br> Email : <input
			type="text" name="email" required > <br> Số đt : <input
			type="text" name="sodt" required > <br> Nội dung : <input
			type="text" name="noidung" required > <input type="submit" value="lưu">
			</div>
	</form>
</body>
</html>